#ifndef RIGHTPANEL_H
#define RIGHTPANEL_H

#include <QFrame>
#include <QPushButton>
#include <QListWidget>
#include <QListWidgetItem>
#include <QDrag>
#include <QMimeData>

class EntityTypeButton;
class EntityListWidget;
class RightPanel : public QFrame
{
    Q_OBJECT
public:
    explicit RightPanel(QWidget *parent = nullptr);
    void initUI();
    void initConnect();

signals:

public slots:
protected:
    void mousePressEvent(QMouseEvent* e) override;

private:
    QStringList mEntityTypes;
    QListWidget *mTypeListWidget;
    EntityListWidget *mEntityListWidget;
};

class EntityTypeButton: public QPushButton{
    Q_OBJECT
public:
    explicit EntityTypeButton(QWidget* parent = nullptr);
    explicit EntityTypeButton(const QString& text = "", QWidget* parent = nullptr);
};

class EntityListWidget: public QListWidget{
    Q_OBJECT
public:
    explicit EntityListWidget(QWidget* parent = nullptr);

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *e) override;
private:
    QListWidgetItem* mDragItem;
    QPoint mLastPressPos;
    bool mItemDragging;
};

#endif // RIGHTPANEL_H
